<div class="field-wrapper">
    <label class="label" nz-tooltip *ngIf="!componentData.extends?.noLabelTxt"
        [nzTooltipTitle]="(componentData && componentData.labelText) ? componentData.labelText : '日期选择'">
        {{(componentData && componentData.labelText) ? componentData.labelText : '日期选择'}}
    </label>
    <ng-container *ngIf="!componentData.disabled;else disabledTpl">
        <div class="field-control" [zeprideAuthority]="zeprideAuthorityData"
            [ngClass]="{'has-form-error': getComponentError(componentData.identifyId)}">
            <nz-date-picker [nzDisabled]="!isAuthorized || componentData.readonly" [nzShowTime]="showTime"
                [nzFormat]="format" class="border-form-item full-width" [ngModel]="dateObject.date"
                (ngModelChange)="dateChanged($event)">
            </nz-date-picker>
        </div>
        <span class="error-tip" *ngIf="getComponentError(componentData.identifyId)">
            <ng-container *ngTemplateOutlet="errorTpl"></ng-container>
        </span>
    </ng-container>
</div>

<ng-template #errorTpl>{{getErrorMsg(componentData.identifyId)}}</ng-template>

<ng-template #disabledTpl>
    <div class="field-control">
        {{dateObject && dateObject.display ? dateObject.display : ''}}
        <i *ngIf="dataChangeLog" class="iconfont icon-file-list-2-line icon-data-change" nz-popover
            [nzPopoverContent]="contentTemplate"></i>
    </div>
</ng-template>

<ng-template #contentTemplate>
    <div class="popover-content">
        <div>近期更正</div>
        <div>更正时间：{{dataChangeLog.time | date: 'yyyy年MM月dd日 HH:mm'}}</div>
        <div>更正内容：由“<span class="font-red">{{dataChangeLog.sourceValue?.display}}</span>”更正为“<span
                class="font-bule">{{dataChangeLog.targetValue?.display}}</span>”
        </div>
    </div>
</ng-template>